//
//  YLGoodsViewModel.m
//  YLFinanceService
//
//  Created by she1323 on 2017/8/24.
//  Copyright © 2017年 she1323. All rights reserved.
//

#import "YLGoodsViewModel.h"

@implementation YLGoodsViewModel

- (RACSubject *)memberCenterSubject
{
    if (!_memberCenterSubject) {
        _memberCenterSubject = [[RACSubject alloc] init];
    }
    return _memberCenterSubject;
}

- (RACSubject *)signSubject
{
    if (!_signSubject) {
        _signSubject = [[RACSubject alloc] init];
    }
    return _signSubject;
}

- (RACSubject *)toProductSubject
{
    if (!_toProductSubject) {
        _toProductSubject = [[RACSubject alloc] init];
    }
    return _toProductSubject;
}

- (NSArray *)goods
{
    if (!_goods) {
        __weak typeof(self) weakSelf = self;
        _goods = @[[YLGoodsModel goodsModelWithImageName:@"financing" name:@"普惠"
                                              clickBlock:^NSString *{
                                                  [weakSelf.toProductSubject sendNext:nil];
                                                  return @"";
        }],
                   [YLGoodsModel goodsModelWithImageName:@"fund" name:@"项目"
                                              clickBlock:^NSString *{
                                                  return @"YLProjectListController";
                   }],
                   [YLGoodsModel goodsModelWithImageName:@"integralSignIn" name:@"积分签到"
                                              clickBlock:^NSString *{
                                                  [weakSelf.signSubject sendNext:nil];
                                                  return @"";
                   }],
                   [YLGoodsModel goodsModelWithImageName:@"MemberCenter" name:@"会员中心"
                                              clickBlock:^NSString *{
                                                  [weakSelf.memberCenterSubject sendNext:nil];
                                                  return @"";
                   }],
                   ];
    }
    
    return _goods;
}
@end
